package com.gagakuai.bpm.mqlistener.camunda.handler;

import java.util.Map;

/*
 * @program: mss_server
 * @description: bpm消费者业务上下文
 * @author: houhong
 * @create: 2022-03-29 10:17
 */
public class BpmConsumeContext {


    private Map<String, AbstractBpmConsumeHandler> handlerMap;


    public BpmConsumeContext(Map<String, AbstractBpmConsumeHandler> handlerMap) {
        this.handlerMap = handlerMap;
    }


    /*
     * 获得处理的世列
     *
     * @param type
     * @return
     */
    public AbstractBpmConsumeHandler getInstance(String type) throws Exception {
        if (type == null) {
            //throw new HxException(BusinessCodeEnum.COMMON_PARAM_NOT_NULL);
        }
        AbstractBpmConsumeHandler clazz = handlerMap.get(type);
        if (clazz == null) {
            // throw new HxException(BusinessCodeEnum.MAIN_BOARD_TYPE_NOT_EXIT);
        }
        return clazz;
    }


}